// pages/UserModule/userPage.js
const app = getApp()
Page({
    data: {
        userInfo: {}
    },
    onLoad: function (options) {
        var that = this
        wx.request({
            url: `http://${app.globalData.target}/user/getBasicInfo`,
            data: {
            },
            header: {
                "hello-token": wx.getStorageSync("hello-token")
            },
            method: 'GET',
            success: function(res){
                console.log(res)
                that.setData({
                    userInfo: res.data.result
                })
            },
            fail: function(e){
                console.log(e)
            }
        })
    },

    onShow: function(){
        this.setData({
            userInfo: {}
        })
        this.onLoad()
    },

    gotoUser: function(e){
        wx.navigateTo({
            url: '../UserModule/myInfo',
        })
    },
    gotoFollowing: function(e){
        wx.navigateTo({
            url: '../UserModule/followingUsers',
        })
    },
    gotoFollowed: function(e){
        wx.navigateTo({
            url: '../UserModule/followedUsers',
        })
    }
})